const routes = [   
    {
      path: '/',
      name: 'index',
      component: () => import(/* webpackChunkName: "main" */'@/views/Main'),
      children: [
        { path: '', component: () => import(/* webpackChunkName: "index" */'@/views/Index') },
        {
          path: 'channel/:id(\\d+)/:subid(\\d+)?',
          name: 'channel',
          props: true,
          component: () => import(/* webpackChunkName: "channel" */'@/views/Channel')      
        },
      ]      
    },    
    {
      path: '/video/:bvid',
      name: 'video',
      props: true,
      component: () => import(/* webpackChunkName: "video" */'@/views/Video')      
    },
    {
      path: '/bangumi/:id',
      name: 'bangumi',
      props: true,
      component: () => import(/* webpackChunkName: "bangumi" */ '@/views/Bangumi')
    },
    {
      path: '/tag/:tid',
      name: 'tag',
      props: true,
      component: () => import(/* webpackChunkName: "tag" */ '@/views/Tag')
    },
    {
      path: '/space/:mid(\\d+)',
      name: 'space',
      props: true,
      component: () => import(/* webpackChunkName: "space" */ '@/views/Space')
    },
    {
      path: '/topic/:name',
      name: 'topic',
      props: true,
      component: () => import(/* webpackChunkName: "topic" */ '@/views/Topic')
    },
    {
      path: '/vote/:vid(\\d+)',
      name: 'vote',
      props: true,
      component: () => import(/* webpackChunkName: "vote" */ '@/views/Vote')
    },
    {
      path: '/article/:id',
      name: 'article',
      props: true,
      component: () => import(/* webpackChunkName: "article" */ '@/views/Article')
    },
    {
      path: '/rank/:id(\\d+)?',
      name: 'rank',
      props: true,
      component: () => import(/* webpackChunkName: "rank" */ '@/views/Rank')
    },
    {
      path: '/lottery/:id',
      name: 'lottery',
      props: true,
      component: () => import(/* webpackChunkName: "lottery" */ '@/views/Lottery')
    },
    {
      path: '/search',
      name: 'search',
      props: (route) => ({ keyword: route.query.keyword }),
      component: () => import(/* webpackChunkName: "search" */ '@/views/Search')
    },
    {
      path: '/404',
      name: '404',
      component: () => import(/* webpackChunkName: "404" */ '@/views/NotFound')      
    },
    {
      path: '/:pathMatch(.*)*',
      redirect: '404'
    }
]
export default routes
  